
local ServerOHOH = _G.ServerOHOH;
local M = ServerOHOH.class.new(script, ServerOHOH.files.BaseComponent());
local game_cfg= ServerOHOH.config.Game

local RankList = ServerOHOH.load.RankList();
local CommonOHOH =_G.CommonOHOH
local ConnectClass=CommonOHOH.load.Connect();

function M.new(self,...)
	return M(self,...);
end;


function M.ctor(self, parent)
	M.super.ctor(self, parent);
	self.data={}

	self.UpdataRankDataEvent=ConnectClass.new() --行走速度

	self:AddProcess(function()
		self:Update();
		self:AddUpdate(self.Update, game_cfg.RankRefreshTime);
	end);
	
end;

function M.dtor(self)
	M.super.dtor(self);
end;

function M.GetData(self)
	return self.data;
end;
local Server_RankManager = ServerOHOH.load.Server_RankManager();

function M.Update(self)

	for k,v in pairs(RankList) do
		self.data[k] = Server_RankManager:GetRankList(k, false, game_cfg.RankListCount);
		
	end

	self.UpdataRankDataEvent:Action(self:GetData())
end;


ServerOHOH.function_manager:SetHandle(ServerOHOH.function_list.get_all_rank, function()
	
	return _G.server:GetComponent(ServerOHOH.load.Server_RankComponent()):GetData();

end);

return M;

